# -*- coding:utf-8 -*-

class MyData:

    def __init__(self, local=True, excel=None, yaml=None, feishu=None):
        self.local = local
        self.excel = excel
        self.yaml = yaml
        self.feishu = feishu

    def userinfo(self, 被测环境, 用户别名):
        user = ''
        if self.excel:
            pass
            # todo 把excel转换为字典的方法
        elif self.yaml:
            pass
            # todo 把yaml转换为字典的方法
        elif self.feishu:
            pass
            # todo  把飞书表格转换为字典的方法
        else:
            user = {"playwright": {"测试员":
                                       {"username": "winni",
                                        "passwd": "dfd5722cef0d7398a9c886a944b4777fdb2ae5426fe65fa4d70689ebecaad2ab54e1b66d1f9145e6e24c73e598af243f"},
                                   "测试经理":
                                       {"username": "zhang20121104", "passwd": "playwright123"}
                                   },
                    "playwright0": {"测试员":
                                        {"username": "winni1", "passwd": "playwright001"},
                                    "测试经理":
                                        {"username": "tracy2012", "passwd": "playwright123"}
                                    }
                    }
        return user[被测环境][用户别名]


if __name__ == '__main__':
    print(MyData().userinfo("playwright", "测试员"))
